import request from '@/utils/request'


const api_url=`/api/hospital`
export default {


  //查询医院列表
  findHospitalPageList(page,limit,searchObj) {
    return request({
      url: `${api_url}/findHospList1/${page}/${limit}`,
      //url: `${api_url}/findHospList1/${page}/${limit}`,
      method: 'GET',
      params: searchObj
    })
  },

  /**
   * 根据id修改医院设置
   * @param hospitalSet
   * @returns {*}
   */
  updateHospitalSetById(hospitalSet) {
    return request({
      url: `/admin/hospital/hospitalSet/updateHospitalSetById`,
      method: 'post',
      data: hospitalSet
    })
  },

  /**
   * 根据id获取医院设置
   * @param id
   * @returns {*}
   */
  getHospitalSetById(id) {
    return request({
      url: `/admin/hospital/hospitalSet/getHospitalSet/${id}`,
      method: 'get',
    })
  },

  /**
   * 添加医院设置
   * @param hospitalSet
   * @returns {*}
   */
  saveHospitalSet(hospitalSet) {
    return request({
      url: `/admin/hospital/hospitalSet/saveHospitalSet`,
      method: 'post',
      data: hospitalSet
    })
  },

  /**
   * 修改医院设置锁定或解锁
   * @param id
   * @param status
   * @returns {*}
   */
  lockHospitalSet(id, status) {
    return request({
      url: `/admin/hospital/hospitalSet/lockHospitalSet/${id}/${status}`,
      method: 'Put'
    })
  },

  /**
   * 批量删除医院设置
   * @param idList
   * @returns {*}
   */
  batchRemoveHospitalSet(idList) {
    return request({
      url: `/admin/hospital/hospitalSet/batchRemoveHospitalSet`,
      method: 'delete',
      data: idList
    })
  },

  /**
   * 根据医院Id进行逻辑删除
   * @param id
   * @returns {*}
   */
  removeHospitalById(id) {
    return request({
      url: `/admin/hospital/hospitalSet/${id}`,
      method: 'delete'
    })
  },

  /**
   * 条件查询加分页
   * @param current
   * @param limit
   * @param searchObj
   * @returns {*}
   */
  findAllHospitalSet(current, limit, searchObj) {
    return request({
      url: `/admin/hospital/hospitalSet/findPageHospitalSet/${current}/${limit}`,
      method: 'post',
      data: searchObj //使用JSON数据传递
    })
  }
}
